import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import shopRouter from './base/Router'
// 导入ElementPlus模块
import ElementPlus from 'element-plus'
// 导入图标模块
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 导入样式表
import 'element-plus/dist/index.css'
// 导入Pinia模块
import { createPinia } from 'pinia'
// 导入图表库
import 'echarts'
import ECharts from 'vue-echarts'

const app = createApp(App)
// 加载ElementPlus模块
app.use(ElementPlus)
// 循环遍历所有图标组件，将其注册为全局组件进行使用
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// 注册路由
app.use(shopRouter)
// 注册Pinia
app.use(createPinia())
// 注册图表组件
app.component('v-chart', ECharts)
app.mount('#app')
